package org.example.design.observer;

import com.alibaba.fastjson.JSON;
import org.example.design.observer.bean.LotteryResult;
import org.example.design.observer.service.impl.LotteryServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Classname Test
 * @Description TODO
 * @Date 2020/11/11 10:19 上午
 * @Created by xiangjd
 */
public class Test {
    private Logger logger = LoggerFactory.getLogger(Test.class);

    @org.junit.Test
    public void test() {
        LotteryServiceImpl lotteryService = new LotteryServiceImpl();
        LotteryResult lotteryResult = lotteryService.doDraw("2765789109876");
        logger.info("摇号结果:{}", JSON.toJSONString(lotteryResult));
    }

    @org.junit.Test
    public void observerTest() {
        org.example.design.observer.event.service.LotteryService lotteryService = new org.example.design.observer.event.service.impl.LotteryServiceImpl();
        LotteryResult lotteryResult = lotteryService.draw("2765789109876");
        logger.info("摇号结果:{}", JSON.toJSONString(lotteryResult));
    }

}
